home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / webPlug / install / Install_webPlug next >
Text File  |  1998-06-10  |  12KB  |  511 lines

  1. ;Install script for WebPlug version 1.45 © 1998 Esteve Boix
  2. ;This install script is © Bo Liljegren (bosse@algonet.se)
  3. ;Updated 04/98 Esteve Boix (again :)
  4. ;
  5.  
  6. (complete 0)
  7.  
  8. ;Pure sequrity. If the Installer, by some strange reason,
  9. ; can't find the default language, it will use english
  10. ; Actually, I've removed the other languages :P
  11.  
  12. (set default_lang 2)
  13.  
  14. ;=============================================================================
  15. ; English strings
  16.  
  17. ;(if (= @language "english")
  18. ;(
  19. (set default_lang 2)
  20.  
  21. (set #low-user-level
  22. (cat "\nWebPlug installation requires at least the \"Average\" user level.\n\n"
  23.      "Restart installation and select appropriate user level."
  24. ))
  25.  
  26. (set #ask-upgrade
  27. (cat "\nIs this a new installation or\n"
  28.      "an upgrade?\n\n"
  29.      "A reinstallation is equal an upgrade"
  30. ))
  31.  
  32. (set #upgr-choice-upgr
  33. (cat "An upgrade"
  34. ))
  35.  
  36. (set #upgr-choice-new
  37. (cat "New installation"
  38. ))
  39.  
  40. (set #which-oldfile
  41. (cat "Where is the program webPlug?\n(The program, NOT the directory webPlug)\n"
  42. ))
  43.  
  44. (set #mess-oldinstaller1
  45. (cat "\nYou are using an old version\nof the Installer program. (%ld.%ld)\n\n"
  46. ))
  47.  
  48. (set #mess-oldinstaller2
  49. (cat "Please use the Installer v43.3"
  50. ))
  51.  
  52. (set #mess-obsoletekick
  53. (cat "webPlug requires AmigaDOS version 3.0 or higher\nPrevious versions are no longer supported..."
  54. ))
  55.  
  56. (set #mess-nomui
  57. (cat "\nwebPlug requires MUI.\nNo muimaster.library is found.\n\n"
  58.      "Sorry, can not continue the installation"
  59. ))
  60.  
  61. (set #mess-oldmui
  62. (cat "\nwebPlug requires MUI version 3.8 or higher.\n\n"
  63.      "That means muimaster.library ver 19.35\n"
  64.      "You have version %ld.%ld\n\n"
  65.      "Sorry, can not continue the installation"
  66. ))
  67.  
  68. (set #which-directory
  69. (cat "Where do you want to install webPlug ?\n(A drawer named \"webPlug\" WILL be created)"
  70. ))
  71.  
  72. (set #confirm-adddocs
  73. (cat "\n\nWould you like to install the (HTML) documentation?"
  74. ))
  75.  
  76. (set #confirm-custom-dirs
  77. (cat "\n\nWould you like to install the CustomTags and CustomStrings directories?"
  78. ))
  79.  
  80. (set #which-language
  81. (cat "\nWhich languages should be installed?\n(english is built-in)"
  82. ))
  83.  
  84. (set #prompt-makemaindir
  85. (cat "Going to create webPlug's dir"
  86. ))
  87.  
  88. (set #prompt-copybrowserlinks
  89. (cat "Going to copy the BrowserLinks dir"
  90. ))
  91.  
  92. (set #prompt-copyplugins
  93. (cat "Going to copy the plugins dir"
  94. ))
  95.  
  96. (set #prompt-adddocs
  97. (cat "Going to copy the (HTML) documentation"
  98. ))
  99.  
  100. (set #prompt-texteditor
  101. (cat "About to install the Texteditor.mcc"
  102. ))
  103.  
  104. (set #prompt-betterstring
  105. (cat "About to install the BetterString.mcc"
  106. ))
  107.  
  108. (set #prompt-popcolor
  109. (cat "About to install the PopColor.mcc"
  110. ))
  111.  
  112. (set #prompt-customtags
  113. (cat "About to install the CustomTags directory"
  114. ))
  115.  
  116. (set #prompt-customstrings
  117. (cat "About to install the CustomStrings directory"
  118. ))
  119.  
  120. (set #prompt-copytoolicons
  121. (cat "About to copy the toolbar image files"
  122. ))
  123.  
  124. (set #prompt-executable
  125. (cat "Going to copy webPlug's executable"
  126. ))
  127.  
  128. (set #mess-congra
  129. (cat "\nCongratulations, webPlug is now installed.\n\n"
  130. ))
  131.  
  132. (set #mess-docsfound
  133. (cat "The documentation is in html format and\n"
  134.      "can be found in the directory \"%s\"\n"
  135.      "Please used your favorite browser to read it.\n"
  136.      "Start with the document \"webPlug.html\"\n\n"
  137. ))
  138.  
  139. (set #mess-shareware
  140. (cat "webPlug is released as Shareware.\n"
  141.      "The fee is only $10, so please consider\n"
  142.      "registering it if you use it.\n\n"
  143.      "Enjoy!"
  144. ))
  145.  
  146. ;))
  147.  
  148. ;=============================================================================
  149. ; procedure to copy the language catalogs
  150.  
  151. (procedure P_InstLocale
  152. (
  153.     (set n 0)
  154.     (while (set #language (select n "català"
  155.                 "english"
  156.                 "español"
  157. ;                "italiano"
  158. ;                "português"
  159.                 "svenska"
  160. ;                "norsk"
  161.                 "deutsch"
  162.                 "français"
  163.                 ""
  164.    ))
  165.     (
  166.    (if (IN #locales n)
  167.    (
  168.    ;; The english language is built in. No need to install it
  169.       (if (<> 1 n)
  170.       (
  171.           (copyfiles
  172.          (source (tackon "/bin/locale/catalogs/" #language))
  173.          (dest (tackon "LOCALE:Catalogs" #language))
  174.          (all)
  175.    )))))
  176.    (set n (+ n 1))
  177. ))))
  178.  
  179. ;========================================================
  180. ; check user-level
  181.  
  182. (if (< @user-level 1)
  183.     (abort (#low-user-level @app-name))
  184. )
  185.  
  186. ;========================================================
  187. ; variable setup
  188.  
  189. (set #installver (/ @installer-version 65536))
  190. (set #installrev (- @installer-version (* #installver 65536)))
  191. (set #tempversion (getversion))
  192. (set #osversion (/ #tempversion 65536))
  193. (set #osrevision (- #tempversion (* #osversion 65536)))
  194. (set #adddocs 0)
  195. (set #frominstdir (pathonly @icon))
  196. (set #frominstdir (substr #frominstdir 0 (- (strlen #frominstdir) (strlen "/install"))))
  197.  
  198. ;========================================================
  199. ; check installer version
  200.  
  201. (if (< #installver 43)
  202.     (
  203.      (abort (#mess-oldinstaller1 #installver #installrev)
  204.              #mess-oldinstaller2)
  205. ))
  206.  
  207. ;========================================================
  208. ; check kickstart version
  209.  
  210. (if (< #osversion 37)
  211.     (
  212.      (abort #mess-obsoletekick)
  213. ))
  214.  
  215. ;========================================================
  216. ; Display picture
  217.  
  218. (if (> (exists ("c:multiview")) 0) (set #mv "c:") )
  219. (if (> (exists ("sys:utilities/multiview")) 0) (set #mv "sys:Utilities") )
  220. (if (> (exists ("sys:tools/multiview")) 0) (set #mv "sys:Tools") )
  221.  
  222. (if (<> #mv 0)
  223.     ((run (cat "run " (tackon #mv "multiview ") "/docs/pics/webPlugS.gif"))))
  224.  
  225.  
  226. ;========================================================
  227. ; check mui (MUI 3.8 = muimaster.library V19.35)
  228.  
  229. (if (= (exists "LIBS:muimaster.library" (noreq)) 1)
  230.     (
  231.      (set #tempver (getversion "LIBS:muimaster.library"))
  232.      (set #muiver (/ #tempver 65536))
  233.      (set #muirev (- #tempver (* #muiver 65536)))
  234.      (if (< #muiver 19)
  235.     (
  236.      (abort (#mess-oldmui #muiver #muirev))
  237.      )))
  238.   ((abort #mess-nomui))
  239. )
  240.  
  241. ;=============================================================================
  242. ; ask new install or upgrade
  243.  
  244. (set #b-upgrade
  245.    (askbool
  246.       (prompt #ask-upgrade)
  247.       (help @askbool-help)
  248.       (choices #upgr-choice-upgr #upgr-choice-new)
  249.    )
  250. )
  251.  
  252. ;=============================================================================
  253. ; where should webPlug be installed
  254.  
  255. (if (= (exists "Work:" (noreq)) 2)
  256.     (set #def-dest "Work:")
  257.     (set #def-dest "SYS:")
  258.     )
  259.  
  260. ;-----------------------------------------------
  261. ; if upgrade, where is the old program?
  262.  
  263. (if (= 1 #b-upgrade)
  264. (
  265.     (set #oldprogfile
  266.    (askfile
  267.        (prompt #which-oldfile)
  268.        (help @askdir-help)
  269.        (default #def-dest)
  270.    )
  271.     )
  272.     (set #directory (pathonly (#oldprogfile)))
  273.  
  274.     ;; If Docs directory exists, new documentation will be installed!
  275.     (if (= (exists (tackon #directory "Docs") (noreq)) 2)
  276.    (set #adddocs 1)
  277.     )
  278. )
  279.  
  280. ;-----------------------------------------------
  281. ; else new install
  282.  
  283. ((set #directory
  284.    (askdir
  285.        (prompt #which-directory)
  286.        (help @askdir-help)
  287.        (default #def-dest)
  288. ))))
  289. (complete 10)
  290.  
  291. ;=============================================================================
  292. ; should documentation be installed?
  293.  
  294. (if (OR (= #adddocs 0) (= @user-level 2))
  295. (
  296.     (set #adddocs
  297.    (askbool
  298.        (prompt #confirm-adddocs)
  299.        (help @askbool-help)
  300.        (default 1)
  301.     ))
  302. ))
  303. (complete 20)
  304.  
  305. ;=============================================================================
  306. ; should CustomTags and CustomStrins directories be installed?
  307.  
  308. (
  309.    (set #addcustom
  310.    (askbool
  311.        (prompt #confirm-custom-dirs)
  312.        (help @askbool-help)
  313.        (default 1)
  314.     ))
  315. )
  316. (complete 20)
  317.  
  318. ;=============================================================================
  319. ; which languages should be installed?
  320.  
  321. (set #locales
  322.    (askoptions
  323.       (prompt #which-language)
  324.       (help @askoptions-help)
  325.       (choices
  326.                       "Català"
  327.                       "English"
  328.                       "Español"
  329. ;                      "Italiano (not complete)"
  330. ;                      "Português (not complete)"
  331.                      "Svenska"
  332. ;                      "Norsk (not complete)"
  333.                       "Deutsch"
  334.                       "Français"
  335.                  )
  336.       (default default_lang)
  337.    )
  338. )
  339. (complete 30)
  340.  
  341. ;=============================================================================
  342. ; if new installation create the main directory
  343.  
  344. (if (= 0 #b-upgrade)
  345. (
  346.    (set @default-dest (tackon #directory "webPlug"))
  347.    (makedir
  348.     (@default-dest)
  349.     (prompt #prompt-makemaindir)
  350.     (help @makedir-help)
  351.     (infos)
  352.    )
  353.    (complete 40)
  354.  
  355. ;-----------------------------------------------
  356. ; and copying icon file for main program/directory
  357.  
  358.    (copyfiles
  359.     (source (cat #frominstdir ".info"))
  360.     (dest (tackon @default-dest '/'))
  361.     (newname 'webPlug.info' )
  362.     (infos)
  363.     (help @copyfiles-help)
  364.    )
  365. )
  366. ;-----------------------------------------------
  367. ; else just set @default-dest
  368.  
  369.     (set @default-dest #directory)
  370. )
  371. (complete 50)
  372.  
  373. ;=============================================================================
  374. ; copy the BrowserLinks directory
  375.  
  376. (copyfiles
  377.    (source "/bin/BrowserLinks")
  378.    (dest (tackon @default-dest "BrowserLinks"))
  379.    (prompt #prompt-copybrowserlinks)
  380.    (all)
  381.    (help @copyfiles-help)
  382. )
  383. (complete 60)
  384.  
  385. ;=============================================================================
  386. ; copy the "toolicons" directory
  387.  
  388. (copyfiles
  389.    (source "/bin/toolicons")
  390.    (dest (tackon @default-dest "toolicons"))
  391.    (prompt #prompt-copytoolicons)
  392.    (all)
  393.    (help @copyfiles-help)
  394. )
  395. (complete 65)
  396.  
  397. ;=============================================================================
  398. ; copy the (HTML) documentation
  399. (set #docs-dest (tackon @default-dest "Docs"))
  400.  
  401. (if (= 1 #adddocs)
  402.    (copyfiles
  403.       (source "/docs")
  404.       (dest #docs-dest)
  405.       (prompt #prompt-adddocs)
  406.       (help @copyfiles-help)
  407.       (all) 
  408.    )
  409. )
  410. (complete 70)
  411. ;=============================================================================
  412. ; copy the CustomTags and CustomStrins directories
  413. (set #docs-dest (tackon @default-dest "Docs"))
  414.  
  415. (if (= 1 #adddocs)
  416.   (
  417.    (copyfiles
  418.       (source "/bin/CustomStrings")
  419.       (dest (tackon @default-dest "CustomStrings"))
  420.       (prompt #prompt-customstrings)
  421.       (all)
  422.       (infos)
  423.       (help @copyfiles-help)
  424.    )
  425.    (copyfiles
  426.       (source "/bin/CustomTags")
  427.       (dest (tackon @default-dest "CustomTags"))
  428.       (prompt #prompt-customstags)
  429.       (all)
  430.       (infos)
  431.       (help @copyfiles-help)
  432.    )
  433.   )
  434. )
  435. (complete 75)
  436. ;=============================================================================
  437. ; install the PopColor.mcc progdir:mui/
  438.  
  439. (copylib
  440.     (source "/bin/mui/popcolor.mcc")
  441.     (dest (tackon @default-dest "mui"))
  442.     (prompt #prompt-popcolor)
  443. )
  444.  
  445. ;=============================================================================
  446. ; install the Texteditor.mcc MUI:Libs/mui/
  447.  
  448. (copylib
  449.     (source "/bin/mui/texteditor.mcc")
  450.     (dest "mui:libs/mui")
  451.     (prompt #prompt-texteditor)
  452. )
  453.  
  454. ;=============================================================================
  455. ; install the BetterString.mcc MUI:Libs/mui/
  456.  
  457. (copylib
  458.     (source "/bin/mui/betterstring.mcc")
  459.     (dest "mui:libs/mui")
  460.     (prompt #prompt-betterstring)
  461. )
  462.  
  463. (complete 85)
  464.  
  465. ;=============================================================================
  466. ; install executable files for webPlug
  467.  
  468. (copyfiles
  469.    (source "/bin/webPlug")
  470.    (dest @default-dest)
  471.    (prompt #prompt-executable)
  472.    (help @copyfiles-help)
  473.    (infos)
  474. )
  475. (complete 90)
  476.  
  477. ;=============================================================================
  478. ; install sample plugins for webPlug
  479.  
  480. (copyfiles
  481.    (source "/bin/webplugins")
  482.    (dest (tackon @default-dest "webplugins"))
  483.    (prompt #prompt-plugins)
  484.    (help @copyfiles-help)
  485.    (infos)
  486.    (all)
  487. )
  488. (complete 95)
  489.  
  490. ;=============================================================================
  491. ; procedure to copy the language catalogs
  492.  
  493. (P_InstLocale)
  494.  
  495. ;=============================================================================
  496. ;Close the mlutiview window
  497.  
  498. (rexx "quit_multiview.rexx")
  499.  
  500. (complete 100)
  501.  
  502. ;=============================================================================
  503. ; That's it!
  504.  
  505. (if (= 1 #adddocs)
  506.    (set #exit-text (cat #mess-congra (#mess-docsfound #docs-dest) #mess-shareware))
  507.    (set #exit-text (cat #mess-congra #mess-shareware) )
  508. )
  509.  
  510. (exit (#exit-text) )
  511.